home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Danny Amor's Online Library
/
Danny Amor's Online Library - Volume 1.iso
/
html
/
startrek
/
misc
/
plot-game.c
< prev
next >
Wrap
Text File
|
1995-08-20
|
6KB
|
298 lines
Path: newserv.ksu.ksu.edu!moe.ksu.ksu.edu!hobbes.physics.uiowa.edu!newsrelay.iastate.edu!vixen.cso.uiuc.edu!howland.reston.ans.net!math.ohio-state.edu!cs.utexas.edu!swrinde!dptspd!TAMUTS.TAMU.EDU!news
From: grw@tamu.edu (George R. Welch)
Newsgroups: alt.startrek.creative
Subject: RE: PLOT GAME
Date: 15 Nov 1993 23:00:48 GMT
Organization: Texas A&M University Atomic Physics
Lines: 284
Distribution: world
Message-ID: <2c91n0$apb@TAMUTS.TAMU.EDU>
NNTP-Posting-Host: leona.tamu.edu
X-Newsreader: <WinQVT/Net v3.9>
Recently chanley@wpi.edu (Christopher S Hanley) wrote
> ...
> Here it is fans!!! The first build yer own TNG plot guide!!!
> Just pick an item from each category and... Voila!!! Your
> own unique TNG plot! Add new entries to each category!
> ...
This reminded me of a little C program that used
to float around, so I thought I'd give it a whirl.
I have no idea how portable the random number junk
is, so your mileage may vary:
/*---------------------- Snip Snip ---------------------*/
#include <stdio.h>
#include <time.h>
#include <ctype.h>
#include <stdlib.h>
static char *Name[] = {
"The starship Enterprise,",
"Captain Picard,",
"Data,",
"Commander Riker,",
"Deanna Troi,",
"Bevery Crusher,",
"Lt. Worf,",
"Geordi LeForge,",
"Wesley Crusher,",
"Guinan,",
"The crew of the Enterprise,",
"A partial shuttlecraft crew,",
"Star Fleet,",
"Earth,",
"A member of the original series,",
};
static char *_while[] = {
"while",
};
static char *doing1[] = {
"on routine patrol,",
"en route to Starbase IV,",
"investigating an unexplored planet,",
"observing a nova,",
"transporting diplomats,",
"on shore leave,",
"at Ten Forward,",
"endulging in a holodeck fantasy,",
"drinking Earl Grey tea,",
"on duty,",
"playing poker,",
"tap dancing,",
"playing the trombone,",
"wishing for more humanity,",
"floating through space,",
"sleeping peacefully,",
"on a rescue mission,",
"on the verge of insurrection,",
"repairing asteriod damage,",
"watching a performance,",
"engaging in diplomacy,",
"recovering from heatbreak,",
};
static char *has[] = {
"is attacked by",
"is captured by",
"is possessed by",
"is propositioned by",
"falls in love with",
"is seduced by",
"is recruited by",
"disappears into",
"is disabled by",
"gets lost in",
"has sex with",
"leaves Star Fleet for",
"is trapped with",
"finds",
"is reunited with",
"is invaded by",
"has a fantasy about",
"is called into duty with",
"recalls a past incident with",
"is impregnated by",
};
static char *something1[] = {
"a Romulan Bird of Prey",
"the Klingon High Council",
"Q",
"a wormhole",
"the ship's computer",
"a time distortion",
"a holodeck fantasy",
"a mysterious probe",
"a Ferengi",
"a trader",
"an upstart officer",
"strange delusions",
"a Star Fleet bureaucrat",
"the Borg",
"a Vulcan emissary",
"an unexplained illness",
"an exotic culture",
"a sexy alien",
"a maverick archeologist",
"Troi's mother",
"Worf's parents",
"an energy anomaly",
"a warp core breach",
"a transporter accident",
"Data",
"Captain Picard",
"Alexander",
};
static char *but[] = {
"but overcomes disaster by",
};
static char *doing2[] = {
"firing",
"converting",
"talking",
"diverting",
"throwing",
"launching",
"tricking",
"rerouting",
"running",
"seducing",
"asking",
"bouncing",
"recalling",
"singing",
"emptying",
"warping",
};
static char *something2[] = {
"a phaser",
"the ship's computer",
"a star's corona",
"Data's circuits",
"Geordi's visor",
"the warp engines",
"the deflector shields",
"a tricorder",
"the ship's sensors",
"holodeck images",
"the transporter",
"a shuttle craft",
"a Klingon opera",
"the prime directive",
"the ship's phasers",
"a photon torpedo",
"Spot the cat",
};
static char *into[] = {
"into",
};
static char *thing[] = {
"a one-time-only sonic pulse;",
"a tachyon-particle disperser;",
"giving up;",
"leaving Star Fleet;",
"a baryon field coil;",
"compensator;",
"a different time-line;",
"breaking up;",
"doing it again;",
"a pattern-matching quantum-energy emitter;",
"a logical implausibility;",
"a matter-anti-matter overload;",
"a communicator;",
"disrobing;",
"self-destruction;",
};
static char *thereby[] = {
"thereby reaffirming that",
};
static char *they[] = {
"all life forms",
"Star Fleet enemies",
"24th century customs",
"the members of the Enterprise crew",
"Star Fleet bureaucrats",
"men and women both",
"aliens",
"space babes",
"space hunks",
"future technologies",
"different ideologies",
"space-time paradoxes",
"the Q continuum",
"Star Trek fans",
};
static char *are[] = {
"are precious.",
"will believe anything.",
"are \"bad\".",
"are deep and meaningful.",
"will never learn.",
"are worthy of respect.",
"are hot.",
"deserve another chance.",
"are an accident waiting to happen.",
"are short-lived.",
"are the pride of the fleet.",
"have better things to do.",
"can't get enough.",
};
struct table {
char **item;
short len;
};
typedef struct table TABLE;
#define SZ(a) sizeof(a) / sizeof(char *)
TABLE list[] = {
Name, SZ(Name),
_while, SZ(_while),
doing1, SZ(doing1),
has, SZ(has),
something1, SZ(something1),
but, SZ(but),
doing2, SZ(doing2),
something2, SZ(something2),
into, SZ(into),
thing, SZ(thing),
thereby, SZ(thereby),
they, SZ(they),
are, SZ(are),
(char **)NULL, (short)NULL,
};
#define LLINE 50
static short lwidth;
void outsp() {
if (lwidth > LLINE) {
putchar('\n');
lwidth = -1;
}
else
putchar(' ');
}
main() {
TABLE *ttp;
char *cp;
long now;
double f;
int j;
now = time(&now);
srand((unsigned int)now);
for (ttp = list; ttp->item; ++ttp, ++lwidth) {
f = (double)rand() - .1;
j = (int)(f/RAND_MAX*ttp->len);
for (cp = ttp->item[j]; *cp; ++cp, ++lwidth) {
if (isspace(*cp))
outsp();
else
putchar(*cp);
}
outsp();
}
if (lwidth)
putchar('\n');
}